package cn.aitstone.controller;

import cn.aitstone.entity.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
/**
 * @Description: user的控制类
 * @Author: Sheldon
 * @Version: 1.0
 * @Date:  2022/7/27 19:25
 */
@RestController
public class UserController {

    @Value("${server.port}")
    private int port;

    @GetMapping("/user/{id}")
    public User getById(@PathVariable Long id){
        return User.builder().id(id).name("李白").intro("诗仙" + port).build();
    }

}
